From 902e5dabbb1ab0612764983c094af398e5f636ee Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 26 Jan 2023 17:02:02 +0700 Subject: Invoice and invoice detail --- src/pages/my/transaction/[id].js | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/pages/my/transaction/[id].js (limited to 'src/pages/my/transaction/[id].js') diff --git a/src/pages/my/transaction/[id].js b/src/pages/my/transaction/[id].js new file mode 100644 index 00000000..09bf1ec7 --- /dev/null +++ b/src/pages/my/transaction/[id].js @@ -0,0 +1,89 @@ +import AppBar from "@/components/layouts/AppBar"; +import Layout from "@/components/layouts/Layout"; +import LineDivider from "@/components/elements/LineDivider"; +import WithAuth from "@/components/auth/WithAuth"; +import { useEffect, useState } from "react"; +import apiOdoo from "@/core/utils/apiOdoo"; +import { useRouter } from "next/router"; +import { useAuth } from "@/core/utils/auth"; +import VariantCard from "@/components/variants/VariantCard"; +import currencyFormat from "@/core/utils/currencyFormat"; +import Disclosure from "@/components/elements/Disclosure"; +import DescriptionRow from "@/components/elements/DescriptionRow"; +import { TransactionDetailAddress } from "@/components/transactions/TransactionDetail"; +import { SkeletonList } from "@/components/elements/Skeleton"; + +export default function DetailTransaction() { + const router = useRouter(); + const { id } = router.query; + const [ auth ] = useAuth(); + const [ transaction, setTransaction ] = useState(null); + + useEffect(() => { + if (auth && id) { + const loadTransaction = async () => { + const dataTransaction = await apiOdoo('GET', `/api/v1/partner/${auth?.partner_id}/sale_order/${id}`); + setTransaction(dataTransaction); + } + loadTransaction(); + } + }, [ auth, id ]); + + return ( + + + + + { transaction ? ( + <> +
+ + Pending Quotation + + + { transaction?.name } + + + { transaction?.purchase_order_name || '-' } + + + { transaction?.payment_term } + + + { transaction?.sales } + + + { transaction?.date_order } + +
+ + + + + +
+ { transaction?.products?.map((product, index) => ( + + )) } +
+

Total Belanja

+

{ currencyFormat(transaction?.amount_total || 0) }

+
+
+ + + + ) : ( +
+ +
+ ) } +
+
+ ); +} \ No newline at end of file -- cgit v1.2.3